package bar.dark.lee.alarm.effect.question;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.Window;
import bar.dark.lee.alarm.R;

public class QuestionResultDialog extends Activity {

	private View viewResult;
	
	public static final String QUESTION_RESULT = "question_result";
	
	public static final int REQUEST_BUTTONRUSH = 0;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		setContentView(R.layout.effectquestion_resultdialog);
	    
	    viewResult = findViewById(R.id.effectQuestionDialog_viewResult);
	    
	    Intent intent = getIntent();
		boolean result = intent.getBooleanExtra(QUESTION_RESULT, false);
		
		if (result)
		{
			viewResult.setBackgroundResource(R.drawable.ic_launcher);
		}
		else
		{
			viewResult.setBackgroundResource(R.drawable.ic_launcher);
		}
		
		Handler handler = new Handler()
		{
			@Override
			public void handleMessage(Message msg) {
				super.handleMessage(msg);
				
				setResult(RESULT_OK);
				
				finish();
				
			}
		};
		
		handler.sendEmptyMessageDelayed(0, 2 * 1000);
	}
	
	@Override
	public void onBackPressed() {
		;
	}
}
